package main

import (
	"AES/change"
	"AES/generate"
)

var S = generate.S_Generate()

// 单一轮,传入此轮的子密钥
func SingleTurn(p *[][]byte, babykey *[]byte) {
	for i := 0; i < 4; i++ {
		for j := 0; j < 4; j++ {
			(*p)[i][j] = generate.S_Change(&S, (*p)[i][j])
		}
	}
	*p = change.Row_Change(p)
	*p = change.Col_Change(p)
	for i := 0; i < 4; i++ {
		for j := 0; j < 4; j++ {
			(*p)[i][j] ^= (*babykey)[i + 4 * j]
		}
	}
}

